package com.wulijie.visitor;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author cui
 * @Data
 */
public class ObjectStruct {
    private List<Person> people = new LinkedList<>();

    public void add(Person person) {
        people.add(person);
    }

    public void remove(Person person){
        people.remove(person);
    }

    public void display(Action action) {
        for (Person person : people) {
            person.actionHandle(action);
        }
    }

}
